#!/bin/bash
frameworkdir=$(cd `dirname $0`; pwd)

appdir=$1
mkdir -p ${appdir}
cd ${appdir}
mkdir web
mkdir web/js
mkdir web/images
mkdir web/css
mkdir config
mkdir models
mkdir templates
mkdir templates/index
mkdir controllers
cp ${frameworkdir}/Application/template/config.json config/config.json
cp ${frameworkdir}/Application/template/.htaccess web/.htaccess
cp ${frameworkdir}/Application/template/Index.php controllers/Index.php
cp ${frameworkdir}/Application/template/index.htm templates/index/index.htm
echo "<?php
    include \"${frameworkdir}/init.php\";
    G_Application::init(G_Application::WEB_APP)->run(\$_GET['__r__']);" > web/index.php
